// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(17,1) == 0;
	question = "special";
	text1 = "You enter a small settlement. The crudely written sign by the road identifies it as Kaz. You see lots of serviles. Some work the fields. Others are armed and on guard. You don't see any humans.";
	text2 = "The war has forced the Shapers to loosen their rules and improvise a bit more, but this is pretty extreme. Serviles in Shaper lands being allowed to hold and defend their own land, without any human influence? Unheard of.";
	text3 = "As you look at the serviles, they look at you. They are clearly unhappy to see you. In fact, openly hostile would be a good way to put it. You suspect that, in the event of even a slight transgression, they would turn their blades on you.";
	text4 = "As you look at the serviles, they look at you. They are clearly unhappy to see you. Even though you are one of their kind, they consider you to be a foreign and untrustworthy creature. Even a small crime won't be tolerated.";
	action = SET_SDF 17 1 1;
	code =
		if (creature_type(pc_num()) == 46)
			rs(3);
			else rs(4);
	break;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(17,2) == 0;
	question = "special";
	text1 = "Kaz is dominated by a large, wooden building, huddled up against the stone cliff face to the west. You can hear a lot of activity inside. Serviles working, shouting, practicing with their weapons.";
	text2 = "The guards at the door and the signs by the entrance tell you that they value their privacy. If you try to sneak in there without permission and are caught, you will probably be attacked.";
	action = SET_SDF 17 2 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(17,3) == 0;
	question = "special";
	text1 = "There is a small, crudely built shack out here in the corner of town. You can faintly hear sounds coming from inside. Muttered speech. The crack of a whip. Howls. More calm speech.";
	text2 = "Something unsettling is going on out here. The participants will probably be very angry if they are disturbed.";
	action = SET_SDF 17 3 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(17,1) == 0;
	question = "special";
	text1 = "You slip into the settlement of Kaz through the Shadow Road. You are deep in their fortification. If you are caught back here, you will probably be attacked.";
	action = SET_SDF 17 1 1;
	code =
		sf(17,2,1);
	break;
	
begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = get_sdf(17,6) == 0;
	question = "special";
	text1 = "This clearing is full of wagons and piles of supplies. More than this little settlement needs. Kaz seems to be a waypoint for the transport of a lot of goods. Odd.";
	action = SET_SDF 17 6 1;
	
begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";	
begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";	
begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  KAZ BATTLE HALL";
	text3 = "  NO ENTRY WITHOUT PERMISSION";
	
begintalknode 9;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  KAZ";
	text3 = "  SERVILE SETTLEMENT";
	text4 = "  THOSE INTERFERING WITH US WILL BE DEALT WITH";
	text5 = "A skull was left on the ground by the sign to help amplify the point.";

begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Bryn";
	text1 = "There is a servile sitting cross-legged on the floor here, staring into the fire. It is extremely warm in here, and the servile is wearing a heavy robe. He still looks cold.";
	text2 = "He pulls his hood back and looks at you. You can see that he is old. You aren't sure how old. Serviles live for a long time, and they age unpredictably. He must have been alive in the earliest years of planning the rebellion.";
	text3 = "He says, _I am Bryn. I lead this settlement. We do not welcome outsiders here. We do not wish battle, but we know how to deal with intruders. So state your business and go._";
	text5 = "Bryn pokes the fire with a stick and takes a sip of water. _Is there still something you want here? State your case. Your presence makes my fellow serviles uncomfortable._";
	action = INTRO;

begintalknode 11;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "Tell me about this settlement.";
	text1 = "_The Shaper Astoria has given us permission to be here. We are not to be disturbed, by her orders. We came here and built it up and called it Kaz, in honor of those who came before us._";
	text2 = "_I can see you have more questions. Ask them so you can go._ This creature's insolence is starting to fill you with a familiar, unwelcome feeling of rage. With effort, you control it. If Bryn noticed, he gives no sign.";
	code =
		if (gf(17,5) > 0)
			rs(2);
	break;

begintalknode 12;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Why did Astoria allow this?";
	text1 = "_Because we took our freedom. We rose up and we did not beg for gifts. We were not pitiful. We were takers. We took what was ours._";
	text2 = "_And we will defend it. If you make it necessary._";
	code =
		if (gf(17,5) > 0)
			rs(2);
	break;
	
begintalknode 13;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Who does the name Kaz honor?";
	text1 = "_Old tales, from the years before the rebellion. The story spread of a village called Kaz, where serviles planned a war against the Shapers. It was destroyed by them._";
	text2 = "_This is but a story, but one that had meaning for us. By calling this place Kaz, I send the signal to all serviles who we are and what we believe._";

begintalknode 14;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "Are there other servile settlements?";
	text1 = "_There is Penta, to the northwest. The serviles there are weaker, more determined to talk than to fight. They call themselves Penta to mock ..._";
	text2 = "He shakes his head. _Our disputes are private things. They are still serviles. Misguided, but not our enemy. Do not try to divide us._";

begintalknode 15;
	state = 10;
	nextstate = 12;
	condition = gf(17,5) == 0;
	question = "Anything I should know about where I can and can't go?";
	text1 = "_You should not be going anywhere here. You are not welcome._";
	text2 = "_You may visit the shop to the south. Labaton is a free creature. He may choose to trade with you. If you enter the large building to the west, you will be killed._";
	text3 = "_The roads out of our town are, of course, open to you._";

begintalknode 16;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "What is in the western building?";
	text1 = "_That is our private business._";

begintalknode 17;
	state = 12;
	nextstate = -1;
	condition = get_stat(20) > 5 && gf(100,9) == 0 && gf(100,10) == 0;
	question = "You want to keep the Shadow Road secret. I understand.";
	text1 = "When you mention the Shadow Road, his eyes flick briefly toward the large building to the west. A tiny, involuntary signal, but a telltale one.";
	text2 = "He says, _I do not discuss the rumors of the Shadow Road._";

begintalknode 18;
	state = 10;
	nextstate = -1;
	condition = gf(100,9) == 0 && gf(100,10) == 0 && gf(100,5) < 2;
	question = "I am looking for something called the Shadow Road.";
	text1 = "_I have heard rumors of that. Just rumors. The road does not exist. There is nothing to free our kind from the cruel dominion of the Shapers._";
	text2 = "_I am through speaking with you. Leave me._";
	text3 = "Though it is very hard to tell what this inscrutable old servile is thinking, he can't hide everything from you. He is lying. The Shadow Road exists. And it's not far away.";
	action = END_TALK;
	code =
		if (get_stat(20) < 5)
			rs(3);
	break;
	
begintalknode 19;
	state = 10;
	nextstate = -1;
	condition = gf(17,5) == 0 && gf(100,5) == 2;
	question = "I am working for Ghaldring. I require your help.";
	text1 = "Bryn nods, though his face betrays no emotion. _I had heard rumors. I heard that you were taken before the great one. That you would help us. Yet, I have had no confirmation._";
	text2 = "_You may wander freely in the settlement. We will not interfere with you. However, we will not spare our limited supplies for you._";
	action = SET_SDF 17 5 1;
	
begintalknode 20;
	state = 10;
	nextstate = 15;
	condition = gf(101,3) == 0 && gf(17,5) > 0 && gf(11,5) < 2;
	question = "I plan to kill the members of the Shaper Council. Do you know anything about Astoria's weaknesses?";
	text1 = "_Astoria. She tried to be good to us. And yet, she is a Shaper. Her crimes are less than the others, but still great. She cannot be trusted. She must die._";
	text2 = "_I regret saying this. I did not want to share this secret. If you can do what you say, though, I have no choice._";

begintalknode 21;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "What secret?";
	text1 = "_An access tunnel, used to escape Haria-Kel if necessary. If there is an explosion. A servile spy there told us the secret._";
	text2 = "_The tunnel can be entered through the back room of the Mera inn._ He describes the stone to push and how to locate it. _The Shapers neglect this route._";
	text3 = "_That tunnel will let you into the back chambers of Haria-Kel. If you wish to avoid the guards at the gate, that is where to go._";
	action = SET_SDF 11 5 1;

begintalknode 22;
	state = 10;
	nextstate = 13;
	condition = gf(17,5) > 0 && gf(100,5) == 2;
	question = "Can you tell me about the Shadow Road?";
	text1 = "_It is the path to freedom. It is a way to free serviles and other creations from the cruelty of the Shapers._";
	text2 = "_Stay away from it. You are already able to defend yourself. It is not a place for you. Some things there are private._";

begintalknode 23;
	state = 10;
	nextstate = -1;
	condition = gf(17,5) > 0;
	question = "Tell me about Ghaldring.";
	text1 = "_He is the one who will make us all free. He will take our freedom from the Shapers._";
	text2 = "_Some fear and hate the mighty drakon. They think he commands too much. Perhaps they are right. When we have our freedom, we shall see what the drakons do. If they become like Shapers, we will take our freedom from them too._";

begintalknode 24;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "But I can enter it?";
	text1 = "_We will not stop you, but it is an unwise idea. We are working in the Shadow Road. Creating things. We do not want outsiders to see them until they are done. If the creators see you, they will attack._";
	text2 = "_Is better for you to stay away. You will learn what they are doing soon enough._";
	
//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Labaton";
	text1 = "There is a servile sitting in this rocking chair, keeping warm by the fire. A crude crutch sits on the floor next to him.";
	text2 = "He can barely walk, but it's not because he is old. His right leg is short and twisted. There is a small bit of exposed skin just above his boot, enough to see the long scar.";
	text3 = "He grabs his crutch and waves it at the motley collection of tools, flasks, and other odd equipment that clutters this shop. _I am Labaton, and this is my shop. You can look. Don't touch._";
	text5 = "Labaton watches you as he sips his tea. Sometimes he shifts around in his chair and winces. Even that slight movement pains his leg.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "Tell me about this shop.";
	text1 = "_See for yourself. I'm just a simple junk dealer. I collect old bits of debris. I sell them. Make a few coppers. Keep myself alive._";
	text2 = "That description of what he does seems a bit misleading. It's not just junk. He clearly specializes in laboratory equipment, the sort used for alchemical and Shaper work.";

begintalknode 32;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Where do you get your stock?";
	text1 = "_People travel through. Merchants. I take things too useless to carry._";

begintalknode 33;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "You seem to have a lot of Shaper equipment.";
	text1 = "_Do I? I think you are mistaken. Though I can't be sure. I don't know anything about the Shapers or their work. It's all junk. Just junk._";

begintalknode 34;
	state = 31;
	nextstate = -1;
	condition = gf(17,5) > 0;
	question = "I am working for Ghaldring. Surely you can tell me a little more.";
	text1 = "Labaton sighs. _Well, I will tell you this. Astoria has weakened the borders. It is a good time to smuggle goods in and out. Especially Shaper equipment. Things that are normally rare and valuable and hard to get._";
	text2 = "_But I don't know much about that. I am a humble junk dealer._";

begintalknode 35;
	state = 31;
	nextstate = 32;
	condition = gf(17,22) < 2;
	question = "Any particular pieces of junk you are looking for? And might pay well for?";
	text1 = "Labaton looks at you closely, considering what is safe to tell you. He finally decides that he has nothing to lose in making an offer.";
	text2 = "_There is one bit of ... junk ... that has eluded me. Northwest of here, in the fens, you can find the ruins of Helft. An old Shaper town._";
	text3 = "_It was destroyed by the Unbound. A bit of justice, that. Anyway, the Shaper there died trying to get his papers out. He didn't succeed. I think the papers are still there._";
	text4 = "_I want them. I will pay very well for them. If you find them, bring them to me._ Giving Shaper knowledge to a servile would definitely please the rebels and irritate the Shapers.";
	code = 
		set_flag(17,22,1);
		toggle_quest(55,1);
	break;
	
begintalknode 36;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Isn't that an odd thing for a junk dealer to want?";
	text1 = "_I buy things other people want. I sell them at a profit. This is my business, not yours._";

begintalknode 37;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Can you tell me more about where the papers might be?";
	text1 = "_I don't even know that they exist. I have just heard rumors. If they are there, there are a lot of people who would want them._";
	text2 = "";

begintalknode 38;
	state = 30;
	nextstate = -1;
	condition = gf(17,22) == 1 && gf(15,1) > 0 && has_spec_item(12) == 0;
	question = "About those papers in Helft. I don't think you'll ever get them.";
	text1 = "Labaton shrugs. _The Shapers are very good at reclaiming their documents. I didn't think I would succeed, but it did not hurt to try._";
	code = 
		set_flag(17,22,2);
		toggle_quest(55,4);
	break;
	
begintalknode 39;
	state = 30;
	nextstate = -1;
	condition = gf(17,22) == 1 && gf(15,1) > 0 && has_spec_item(12) > 0;
	question = "I recovered those papers from Helft for you. (Give them.)";
	text1 = "Labaton takes the papers and flips through them. _Yes ... Yes ... This is a very interesting bit of ... junk. It is rare for a servile to even see papers like this._";
	text2 = "He rises from his chair and hobbles over to a chest. He gets a pair of pants from it and brings them to you. _I can't wear these anymore, but you might find them of value._ He also gives you a pouch of silver coins.";
	text3 = "_I will make sure that the other serviles learn how you have aided us._";
	code = 
		set_flag(17,22,2);
		toggle_quest(55,3);
		award_party_xp(200,20);
		set_spec_item(12,-1);
		reward_give(351);
		change_coins(200);
		inc_flag(100,0,-3);
	break;
	
begintalknode 40;
	state = 30;
	nextstate = 33;
	condition = 1;
	question = "What happened to your leg?";
	text1 = "He looks down at the twisted limb and frowns. _War trall._";

begintalknode 41;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "A war trall did this to you?";
	text1 = "_One thrown rock. But a glancing blow. Then the war was over for me. And ... I do not wish to discuss it._";

begintalknode 42;
	state = 30;
	nextstate = -1;
	condition = gf(100,0) - get_stat(20) >= 100;
	question = "I would like to trade with you.";
	text1 = "_I do not deal with those loyal to the Shapers._ You try to convince him that he should trade with you, but your words aren't convincing enough to overcome what he has heard about you.";

begintalknode 43;
	state = 30;
	nextstate = 35;
	condition = gf(100,0) - get_stat(20) < 100;
	question = "I would like to trade with you.";
	text1 = "_I suppose that you are not too hostile to my kind. I do not trade with those who serve the Shapers, but you are suitable._";
	text2 = "_I buy junk. I sell junk. What do you want?_";

begintalknode 44;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "Buy junk.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Labaton",
		  "Labaton claims to merely sell junk he has stumbled across. A cursory examination of his goods shows that this isn't the truth.",
		  22,4,0);	
	break;


begintalknode 45;
	state = 35;
	nextstate = -1;
	condition = 1;
	question = "Sell junk.";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode 46;
	state = 35;
	nextstate = 30;
	condition = 1;
	question = "Nothing else.";
	text1 = "_I am starting to tire. Anything else before I can rest?_";

//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Celaa";
	text1 = "There is an armed servile out here watching closely over the wagons. She must be from one of the servile lines made for work in mines and other harsh environments. She is a brick of solid muscle with legs.";
	text2 = "When you get close to the supplies, she keeps a close watch on you. Her hand is always close to her baton. You see that her hands and face are marked with burns and several scars.";
	text3 = "When she notices you staring at her, she says, _I Celaa. I watch goods. Watch hall._ She points at the hall to the west. _Stay back. Am guard._";
	text4 = "Many of the rebel serviles speak your language very well. Celaa is not one of them.";
	text5 = "Celaa stays close to you, making sure that you don't try to break or steal something. She isn't entirely hostile, though. She seems genuinely curious about you.";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "Where are you from?";
	text1 = "Celaa says, _From far to west. From foundry. From Nodye Coast._ That is the province on the west coast. The rebellion has not reached there yet. It must have been very difficult for her to get here.";
	text2 = "_Come here. Like Kaz. Guard it._";

begintalknode 52;
	state = 50;
	nextstate = 52;
	condition = 1;
	question = "Tell me about Kaz.";
	text1 = "_It little town. Not like coast. Big town there. Small town here. Lots of trees. I fight to defend. Bryn lets me lead._";
	text2 = "_Must fight rogue. Rogue to east. Must take servile. Go help with rogue. But have to stay here. Can't go east. Makes angry._";
	code =	
		if ((gf(17,7) > 1) || (gf(31,4) > 0))
			rs(2);
	break;
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "What do you know about the rebellion?";
	text1 = "She shakes her head. _That is ..._ She tries to recall the word. _Politics. Armies. War. Many things. Big things. Not know. I spend most of life in mine._";
	text2 = "_This is Kaz. Is my little place. I fight for this. I fight for Kaz._";
	
begintalknode 54;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "How did you get here? The Shadow Road?";
	text1 = "Though Celaa is a guileless creature, she realizes that she has already said too much to you. She decides to respond to that question with silence.";
	
begintalknode 55;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "Have you fought much before you came here?";
	text1 = "_No. Never. Here, they see me strong. They teach me talk good. They teach me fight. I fight to keep safe. Fight enemy. Bryn put me to guard here. Am proud._";
	
begintalknode 56;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "Tell me about Bryn.";
	text1 = "_Bryn leader. Bryn good. Bryn teach me. Say I must take freedom. Hates outsiders, though. Says I fear them. Not. I want to meet them. Like you. Don't tell Bryn I say so._";
	
begintalknode 57;
	state = 52;
	nextstate = -1;
	condition = gf(17,7) < 2 && get_stat(20) < 5 && gf(31,4) == 0;
	question = "Tell me about the rogues to the east. Maybe I can help.";
	text1 = "You try to trick her into telling you more. No luck. _No. Bryn says I help. Bryn says I not tell outsider thing. I not make Bryn angry._";
	
begintalknode 58;
	state = 52;
	nextstate = 53;
	condition = gf(17,7) < 2 && get_stat(20) >= 5 && gf(31,4) == 0;
	question = "Tell me about the rogues to the east. I'm sure Bryn would want you to get other warriors to fight for you.";
	text1 = "You try to trick her into telling you more. Success. _Hmmm. Bryn say not trust outsiders. But he say we need to fight. If you fight for us, I let you._";
	text2 = "_East is swamp. Is camp of servile soldier there. Hiding. They hunt rogue in swamp. Not enough. Need help. Tell them I send you. Help them stay alive, or rogue wipe them out._";
	text3 = "Interesting. A hidden, isolated group of armed, independent serviles. If you got rid of them, the Shapers would be pleased. If you helped them, the rebels would approve.";
	code = 
		set_flag(17,7,1);
		toggle_quest(56,1);

	break;		
	
begintalknode 59;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "How can I find them?";
	text1 = "_Go east. Look for a servile. Say I send. That servile lead you to others._";

begintalknode 60;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "Why do you hunt rogues? Aren't they creations too?";
	text1 = "_Wild beasts. Not calm. Not good. They roam. They kill. Kill us. Sad to kill them, but what we must do._";

//


begintalknode 70;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "There are quite a few creations in the pens here. Some are wounded and are being nursed to health. Others are in good health and are probably here to guard the settlement from attackers.";
	text2 = "The thing that strikes you as unusual is that nobody is controlling these creations. They have been freed from Shaper influence for some time. The serviles are keeping them under control with simple, kind treatment.";
	text3 = "Oddly, they and the shredbugs are mostly ignoring each other.";
	code =
		if (gf(100,13) < 2)
			rs(3);
	break;

begintalknode 71;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You try to speak with the serviles who are tending to the fields. They don't want to talk to you. When you get close, they simply walk away.";
	text2 = "Getting this sort of treatment from other serviles is rather startling.";
	text3 = "You notice that some of them have scars on their hands and faces. Not battle or torture scars, but carefully applied ceremonial patterns. Odd.";
	code =
		if (creature_type(pc_num()) != 46)
			rs(2);
	break;

begintalknode 72;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "You try to speak with the guards, only to be turned away. They don't want to speak with you. Their hands are never far from their weapons. They are ready to deal with even the slightest infraction with deadly force.";
	text2 = "Getting this sort of treatment from other serviles is rather startling.";
	text3 = "You notice that some of them have scars on their hands and faces. Not battle or torture scars, but carefully applied ceremonial patterns. Odd.";
	code =
		if (creature_type(pc_num()) != 46)
			rs(2);
	break;

begintalknode 73;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "These serviles have just emerged from the Shadow Road. They are still recovering from their traumatic and terrifying journey. You let them rest.";

begintalknode 74;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "One of the serviles in this building has sighted you. They have had enough of your intrusion. He points at you and shouts an alarm.";

begintalknode 75;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "One of the serviles in this building has sighted you. _You should not be back here. Go. Go out now, or we kill you._";
	text2 = "If you don't leave soon, the serviles are going to be very angry.";
	
begintalknode 76;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
		